<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<h1>
	<fmt:message key="archive.list.title" />
</h1>
<table class="search">
	<tr>
		<th><fmt:message key="archive.form.token" /></th>
		<th><fmt:message key="archive.form.name" /></th>
		<th><fmt:message key="archive.form.description" /></th>
	</tr>
	<c:forEach var="archive" items="${archivesOfUser}" varStatus="status">
		
		<c:url var="deleteUrl" value="/archive/delete.html">
			<c:param name="token" value="${archive.token}" />
		</c:url>
		
		<c:url var="validateUrl" value="/archive/validate.html">
			<c:param name="token" value="${archive.token}" />
		</c:url>
		
		<c:url var="infoUrl" value="/evidenceRecord/listOfEvidenceRecords.html">
			<c:param name="token" value="${archive.token}" />
		</c:url>
		
		<tr>
			<td>${archive.token}</td>
			<td>${archive.name}</td>
			<td>${archive.description}</td>
			<td><a href='<c:out value="${infoUrl}"/>'><img alt="info" src="<c:url value="/images/info16.png"/>" border="0"></a><td>
			<td><a href='<c:out value="${deleteUrl}"/>'><img alt="trash" src="<c:url value="/images/trash16.png"/>" border="0"></a><td>
			<td><a href='<c:out value="${validateUrl}"/>'><img alt="valid" src="<c:url value="/images/valid16.png"/>" border="0"></a><td>
		</tr>
	</c:forEach>
</table>
<br>
<c:if test="${controlledArchive != null}">
	<h3><fmt:message key="archive.validation.title" /></h3>
	<table class="search">
		<tr>
			<th><fmt:message key="archive.form.token" /></th>
			<th><fmt:message key="archive.form.name" /></th>
			<th><fmt:message key="archive.form.description" /></th>
		</tr>
		<tr>
			<td>${controlledArchive.token}</td>
			<td>${controlledArchive.name}</td>
			<td>${controlledArchive.description}</td>
		</tr>
	</table>
	<c:if test="${isValid}">
		<img alt="info" src="<c:url value="/images/valid32.png"/>" border="0">
		<fmt:message key="archive.validation.ok">
			<fmt:param value="${controlledArchive.token}"/>
		</fmt:message>
	</c:if>
	<c:if test="${!isValid}">
		<img alt="info" src="<c:url value="/images/notValid32.ico"/>" border="0">
		<fmt:message key="archive.validation.no">
			<fmt:param value="${controlledArchive.token}"/>
		</fmt:message>
	</c:if>
</c:if>